﻿<form class="layui-form" lay-filter="edition-form" style="padding: 15px 0 0 0;">
    <input type="hidden" name="id" />
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input name="displayName" class="layui-input" type="text" placeholder="请输入名称" autocomplete="off" lay-verify="required">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-hide" lay-submit lay-filter="edition-submit" id="edition-submit">提交</button>
        </div>
    </div>
</form>

@section scripts{
    <script type="text/javascript">
        layui.use(['element', 'form'], function () {
            var $ = layui.$;
            var form = layui.form;
            var element = layui.element;

            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.iframeAuto(index);

            form.render();

            window.submitForm = function(){
                $("#edition-submit").click();
            }

            form.on('submit(edition-submit)', function (data) {
                parent.selectedWindow();
                return false;
            });

            element.on('tab(edition-tab)', function(data){
                parent.layer.iframeAuto(index);
            });
        });
    </script>
}